﻿using Microsoft.Practices.Prism.Modularity ;
using Microsoft.Practices.Prism.Regions ;
using Microsoft.Practices.ServiceLocation ;
using Microsoft.Practices.Prism.MefExtensions.Modularity ;
using Microsoft.Practices.Prism.Logging;

namespace PrismExample.Clock
{
    [ModuleExport("Clock", typeof(ModuleInit))]
    public class ModuleInit : IModule
    {

        #region IModule Members

        public void Initialize()
        {
            
            var regionManager = ServiceLocator.Current.GetInstance<IRegionManager>( ) ;
            regionManager.RegisterViewWithRegion( "MainRegion", typeof(View) ) ;

            var logger = ServiceLocator.Current.GetInstance<ILoggerFacade>( ) ;
            logger.Log( "Clock loaded", Category.Debug, Priority.Low ) ;

        }

        #endregion
    }
}
